<?php
    function list_files($directory){
        $file_name = array();
        if ($directory != '.')
        {
            $directory = rtrim($directory, '/') . '/';
        }
        
        if ($handle = opendir($directory))
        {
            while (false !== ($file = readdir($handle)))
            {
                if ($file != '.' && $file != '..')
                {
                    array_push($file_name,$directory.$file);
                }
            }
            closedir($handle);
            return $file_name;
        }
    }
	
	function GetImageFirst($path){
		$file = list_files($path);
        if(isset($file[0])){
            return $file[0];
        }
		return "../image/album/album1.jpg";
	}
	
    function PrintDeleteImage4Mod($value1,$value2,$value3,$value4){
        printf( "<tr>
                    <td>
                       <form method=\"post\" action=''>
                        <img class=\"nailthumb-container square\" src='".$value1."'/>
                        <input type=\"hidden\" name=\"file\" value='".$value1."' /> 
                        <input type=\"submit\" value=\"Xoa\" />
                        </form>
                    </td>
                    <td>
                       <form method=\"post\" action=''>
                       <img class=\"nailthumb-container square\" src='".$value2."'/>
                       <input type=\"hidden\" name=\"file\" value='".$value2."' /> 
                       <input type=\"submit\" value=\"Xoa\" />
                       </form>
                    </td>
                    <td>
                        <form method=\"post\" action=''>
                        <img class=\"nailthumb-container square\" src='".$value2."'/>
                        <input type=\"hidden\" name=\"file\" value='".$value2."' /> 
                        <input type=\"submit\" value=\"Xoa\" />
                        </form>
                    </td>
                    <td>
                        <form method=\"post\" action=''>
                        <img class=\"nailthumb-container square\" src='".$value3."'/>
                        <input type=\"hidden\" name=\"file\" value='".$value3."' /> 
                        <input type=\"submit\" value=\"Xoa\" />
                        </form>
                    </td>
                    </tr>");                        
    }
    
    function PrintDeleteImage1Mod($value){
         printf( "<tr>
         <td>
             <form method=\"post\" action=''>
             <img class=\"nailthumb-container square\" src='".$value."'/>
             <input type=\"hidden\" name=\"file\" value='".$value."' /> 
             <input type=\"submit\" value=\"Xoa\" />
             </form>
         </td>
         <td>
                                    
         </td>
         <td>
                                
         </td>
         <td>
                                   
         </td>
         </tr>");
    }
    
    function PrintDeleteImage2Mod($value1,$value2){
        printf( "<tr>
            <td>
                <form method=\"post\" action=''>
                <img class=\"nailthumb-container square\" src='".$value1."'/>
                <input type=\"hidden\" name=\"file\" value='".$value1."' /> 
                <input type=\"submit\" value=\"Xoa\" />
                </form>
            </td>
            <td>
                <form method=\"post\" action=''>
                <img class=\"nailthumb-container square\" src='".$value2."'/>
                <input type=\"hidden\" name=\"file\" value='".$value2."' /> 
                <input type=\"submit\" value=\"Xoa\" />
                </form>
            </td>
            <td>
            </td>
            <td>                  
            </td>
            </tr>");
    }
    
    function PrintDeleteImage3Mod($value1,$value2,$value3){
        printf( "<tr>
        <td>
            <form method=\"post\" action=''>
            <img class=\"nailthumb-container square\" src='".$value1."'/>
            <input type=\"hidden\" name=\"file\" value='".$value1."' /> 
            <input type=\"submit\" value=\"Xoa\" />
            </form>
        </td>
        <td>
            <form method=\"post\" action=''>
            <img class=\"nailthumb-container square\" src='".$value2."'/>
            <input type=\"hidden\" name=\"file\" value='".$value2."' /> 
            <input type=\"submit\" value=\"Xoa\" />
            </form>
        </td>
        <td>
            <form method=\"post\" action=''>
            <img class=\"nailthumb-container square\" src='".$value3."'/>
            <input type=\"hidden\" name=\"file\" value='".$value3."' /> 
            <input type=\"submit\" value=\"Xoa\" />
            </form>
        </td>
        <td>
        </td>
        </tr>");
    }
    
    function PrintAlbumSkirtImage1Mod($value1,$link){
        printf( "<tr>
         <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value1['DIR_VAY']."'>
            <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
            </a>
            </div>
         </td>
        <td>
                                    
        </td>
        <td>
                                
        </td>
        <td>
                                   
        </td>
        </tr>");
    }
    
    function PrintAlbumSkirtImage2Mod($value1, $value2,$link){
         printf( "<tr>
                     <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['DIR_VAY']."'>
                        <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value2['DIR_VAY']."'>
                        <div class='mask'><h2>".$value2['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintAlbumSkirtImage3Mod($value1, $value2, $value3,$link){
        printf( "<tr>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['DIR_VAY']."'>
                        <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value2['DIR_VAY']."'>
                        <div class='mask'><h2>".$value2['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value3['DIR_VAY']."'>
                        <div class='mask'><h2>".$value3['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintAlbumSkirtImage4Mod($value1, $value2, $value3, $value4,$link){
        printf( "<tr>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value1['DIR_VAY']."'>
            <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value2['DIR_VAY']."'>
            <div class='mask'><h2>".$value2['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value3['DIR_VAY']."'>
            <div class='mask'><h2>".$value3['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value4['DIR_VAY']."'>
            <div class='mask'><h2>".$value4['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        </tr>");
    }
	
	function PrintAlbumSkirtViewImage1Mod($value1,$link){
        printf( "<tr>
         <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value1['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value1['DIR_VAY'])."' />
            <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
            </a>
            </div>
         </td>
        <td>
                                    
        </td>
        <td>
                                
        </td>
        <td>
                                   
        </td>
        </tr>");
    }
    
    function PrintAlbumSkirtViewImage2Mod($value1, $value2,$link){
         printf( "<tr>
                     <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value1['DIR_VAY'])."' />
                        <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value2['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value2['DIR_VAY'])."' />
                        <div class='mask'><h2>".$value2['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintAlbumSkirtViewImage3Mod($value1, $value2, $value3,$link){
        printf( "<tr>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value1['DIR_VAY'])."' />
                        <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value2['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value2['DIR_VAY'])."' />
                        <div class='mask'><h2>".$value2['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value3['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value3['DIR_VAY'])."' />
                        <div class='mask'><h2>".$value3['NAME_VAY']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintAlbumSkirtViewImage4Mod($value1, $value2, $value3, $value4,$link){
        printf( "<tr>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value1['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value1['DIR_VAY'])."' />
            <div class='mask'><h2>".$value1['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value2['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value2['DIR_VAY'])."' />
            <div class='mask'><h2>".$value2['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value3['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value3['DIR_VAY'])."' />
            <div class='mask'><h2>".$value3['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        <td>
            <div class='view view-first' id='table'>
            <a href='".$link."?t=".$value4['DIR_VAY']."'><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumvay/".$value4['DIR_VAY'])."' />
            <div class='mask'><h2>".$value4['NAME_VAY']."</h2></div>
            </a>
            </div>
        </td>
        </tr>");
    }
    
    function PrintAlbumWeddingImage1Mod($value1, $link){
        printf( "<tr>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['PATH_ALBUM']."'>
                        <div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                                                
                    </td>
                    <td>
                                            
                    </td>
                    <td>
                                               
                    </td>
                </tr>");
    }
    
    function PrintAlbumWeddingImage2Mod($value1, $value2, $link){
         printf( "<tr>
                     <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['PATH_ALBUM']."'>
                        <div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value2['PATH_ALBUM']."'>
                        <div class='mask'><h2>".$value2['NAME_ALBUM']."</h2></div>
                        </a>
                        </div>
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintAlbumWeddingImage3Mod($value1, $value2, $value3, $link){
        printf( "<tr>
                   <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value1['PATH_ALBUM']."'>
                        <div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value2['PATH_ALBUM']."'>
                        <div class='mask'><h2>".$value2['NAME_ALBUM']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                        <div class='view view-first' id='table'>
                        <a href='".$link."?t=".$value3['PATH_ALBUM']."'>
                        <div class='mask'><h2>".$value3['NAME_ALBUM']."</h2></div>
                        </a>
                        </div>
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintAlbumWeddingImage4Mod($value1, $value2, $value3, $value4, $link){
        printf( "<tr>
            <td>
                <div class='view view-first' id='table'>
                <a href='".$link."?t=".$value1['PATH_ALBUM']."'>
                <div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
                </a>
                </div>
            </td>
            <td>
                <div class='view view-first' id='table'>
                <a href='".$link."?t=".$value2['PATH_ALBUM']."'>
                <div class='mask'><h2>".$value2['NAME_ALBUM']."</h2></div>
                </a>
                </div>
            </td>
            <td>
                <div class='view view-first' id='table'>
                <a href='".$link."?t=".$value3['PATH_ALBUM']."'>
                <div class='mask'><h2>".$value3['NAME_ALBUM']."</h2></div>
                </a>
                </div>
            </td>
            <td>
                <div class='view view-first' id='table'>
                <a href='".$link."?t=".$value4['PATH_ALBUM']."'>
                <div class='mask'><h2>".$value4['NAME_ALBUM']."</h2></div>
                </a>
                </div>
            </td>
        </tr>");
    }
    
    function PrintAlbumSkirtDelete1Mod($value1){
        printf( "<tr>
                    <td>
                        <h2>".$value1['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_VAY']."','".$value1['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                                                
                    </td>
                    <td>
                                            
                    </td>
                    <td>
                                               
                    </td>
                </tr>");
    }
    
    function PrintAlbumSkirtDelete2Mod($value1, $value2){
         printf( "<tr>
                    <td>
                        <h2>".$value1['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_VAY']."','".$value1['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value2['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value2['ID_VAY']."','".$value2['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintAlbumSkirtDelete3Mod($value1, $value2, $value3){
        printf( "<tr>
                   <td>
                        <h2>".$value1['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_VAY']."','".$value1['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value2['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value2['ID_VAY']."','".$value2['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value3['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value3['ID_VAY']."','".$value3['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintAlbumSkirtDelete4Mod($value1, $value2, $value3, $value4){
        printf( "<tr>
                    <td>
                        <h2>".$value1['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_VAY']."','".$value1['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value2['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value2['ID_VAY']."','".$value2['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value3['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value3['ID_VAY']."','".$value3['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value4['NAME_VAY']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value4['ID_VAY']."','".$value4['DIR_VAY']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                </tr>");
    }
    
    function PrintAlbumWeddingDelete1Mod($value1){
        printf( "<tr>
                    <td>
                        <h2>".$value1['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_ALBUM']."','".$value1['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                                                
                    </td>
                    <td>
                                            
                    </td>
                    <td>
                                               
                    </td>
                </tr>");
    }
    
    function PrintAlbumWeddingDelete2Mod($value1, $value2){
         printf( "<tr>
                    <td>
                        <h2>".$value1['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_ALBUM']."','".$value1['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value2['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value2['ID_ALBUM']."','".$value2['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintAlbumWeddingDelete3Mod($value1, $value2, $value3){
        printf( "<tr>
                   <td>
                        <h2>".$value1['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_ALBUM']."','".$value1['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value2['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value2['ID_ALBUM']."','".$value2['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value3['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value3['ID_ALBUM']."','".$value3['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintAlbumWeddingDelete4Mod($value1, $value2, $value3, $value4){
        printf( "<tr>
                    <td>
                        <h2>".$value1['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value1['ID_ALBUM']."','".$value1['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value2['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value2['ID_ALBUM']."','".$value2['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value3['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value3['ID_ALBUM']."','".$value3['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                    <td>
                        <h2>".$value4['NAME_ALBUM']."</h2>
                        <a href=\"#\" onclick=\"deletedata('".$value4['ID_ALBUM']."','".$value4['PATH_ALBUM']."')\" style=\"color:#FF0000\"><b>Delete</b></a>
                    </td>
                </tr>");
    }
    
    //delete image album weeding
    
    function PrintImageAlbumWeddingDelete1Mod($value1){
        printf( "<tr>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value1."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value1."')\" value=\"Xoa\" />
                    </td>
                    <td>
                                                
                    </td>
                    <td>
                                            
                    </td>
                    <td>
                                               
                    </td>
                </tr>");
    }
    
    function PrintImageAlbumWeddingDelete2Mod($value1, $value2){
         printf( "<tr>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value1."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value1."')\" value=\"Xoa\" />
                    </td>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value2."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value2."')\" value=\"Xoa\" />
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintImageAlbumWeddingDelete3Mod($value1, $value2, $value3){
        printf( "<tr>
                   <td>
                        <img class=\"nailthumb-container square\" src='".$value1."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value1."')\" value=\"Xoa\" />
                    </td>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value2."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value2."')\" value=\"Xoa\" />
                    </td>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value3."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value3."')\" value=\"Xoa\" />
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintImageAlbumWeddingDelete4Mod($value1, $value2, $value3, $value4){
        printf( "<tr>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value1."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value1."')\" value=\"Xoa\" />
                    </td>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value2."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value2."')\" value=\"Xoa\" />
                    </td>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value3."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value3."')\" value=\"Xoa\" />
                    </td>
                    <td>
                        <img class=\"nailthumb-container square\" src='".$value4."'/>
                        <input type=\"submit\" onclick=\"deletedata('".$value4."')\" value=\"Xoa\" />
                    </td>
                </tr>");
    }
	
	function PrintFormAlbumWeddingImage1Mod($value1, $link, $i){
        printf( "<tr>
                    <td>
						<form action='".$link."' method='post' id=id".$i.">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".$i.".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value1['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value1['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value1['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                                                
                    </td>
                    <td>
                                            
                    </td>
                    <td>
                                               
                    </td>
                </tr>");
    }
    
    function PrintFormAlbumWeddingImage2Mod($value1, $value2, $link, $i){
         printf( "<tr>
                     <td>
                        <form action='".$link."' method='post' id=id".$i.">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".$i.".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value1['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value1['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value1['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                        <form action='".$link."' method='post' id=id".($i+1).">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".($i+1).".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value2['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value2['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value2['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value2['URL_ALBUM'].">
						</form>
                    </td>
                     <td>
                     </td>
                     <td>
                                                
                     </td>
                </tr>");
    }
    
    function PrintFormAlbumWeddingImage3Mod($value1, $value2, $value3, $link ,$i){
        printf( "<tr>
                  <td>
                        <form action='".$link."' method='post' id=id".$i.">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".$i.".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value1['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value1['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value1['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                        <form action='".$link."' method='post' id=id".($i+1).">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".($i+1).".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value2['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value2['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value2['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value2['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                        <form action='".$link."' method='post' id=id".($i+2).">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".($i+2).".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value3['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value3['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value3['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value3['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                    </td>
            </tr>");
    }
    
    function PrintFormAlbumWeddingImage4Mod($value1, $value2, $value3, $value4, $link, $i){
        printf( "<tr>
            <td>
                        <form action='".$link."' method='post' id=id".$i.">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".$i.".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value1['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value1['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value1['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value1['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                        <form action='".$link."' method='post' id=id".($i+1).">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".($i+1).".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value2['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value2['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value2['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value2['URL_ALBUM'].">
						</form>
                    </td>
                    <td>
                        <form action='".$link."' method='post' id=id".($i+2).">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".($i+2).".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value3['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value3['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value3['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value3['URL_ALBUM'].">
						</form>
                    </td>
					<td>
                        <form action='".$link."' method='post' id=id".($i+3).">
                        <div class='view view-first' id='table'>
							<a href='#' onclick=id".($i+3).".submit()><img class=\"nailthumb-container square\" src='".GetImageFirst("../upload/albumcuoi/".$value4['PATH_ALBUM'])."' />
							<div class='mask'><h2>".$value4['NAME_ALBUM']."</h2></div>
							</a>
                        </div>
							 <input type=hidden name=pathalbum value=".$value4['PATH_ALBUM'].">
							 <input type=hidden name=urlalbum value=".$value4['URL_ALBUM'].">
						</form>
                    </td>
        </tr>");
    }
	
    
    function PrintImageAlbumWeddingDelete($numfile,$list_file){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintImageAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintImageAlbumWeddingDelete1Mod($list_file[$i]);
                        }else{
                            PrintImageAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintImageAlbumWeddingDelete2Mod($list_file[$i],$list_file[$i+1]);
                        }else{
                            PrintImageAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintImageAlbumWeddingDelete3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2]);
                        }else{
                            PrintImageAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }
        }
    
    //end funtion delete image album wedding
    
    
    function print_table($numfile,$list_file){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintDeleteImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintDeleteImage1Mod($list_file[$i]);
                        }else{
                            PrintDeleteImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintDeleteImage2Mod($list_file[$i],$list_file[$i+1]);
                        }else{
                            PrintDeleteImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintDeleteImage3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2]);
                        }else{
                            PrintDeleteImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }
        }
        
        function PrintAlbumSkirtImage($numfile,$list_file,$link){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintAlbumSkirtImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintAlbumSkirtImage1Mod($list_file[$i],$link);
                        }else{
                            PrintAlbumSkirtImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintAlbumSkirtImage2Mod($list_file[$i],$list_file[$i+1],$link);
                        }else{
                            PrintAlbumSkirtImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintAlbumSkirtImage3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2],$link);
                        }else{
                            PrintAlbumSkirtImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }
        }
		
		function PrintAlbumSkirtViewImage($numfile,$list_file,$link){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintAlbumSkirtViewImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintAlbumSkirtViewImage1Mod($list_file[$i],$link);
                        }else{
                            PrintAlbumSkirtViewImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintAlbumSkirtViewImage2Mod($list_file[$i],$list_file[$i+1],$link);
                        }else{
                            PrintAlbumSkirtViewImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintAlbumSkirtViewImage3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2],$link);
                        }else{
                            PrintAlbumSkirtViewImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }
        }
        
        function PrintAlbumWeddingImage($numfile,$list_file,$link){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintAlbumWeddingImage1Mod($list_file[$i],$link);
                        }else{
                            PrintAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintAlbumWeddingImage2Mod($list_file[$i],$list_file[$i+1],$link);
                        }else{
                            PrintAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintAlbumWeddingImage3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2],$link);
                        }else{
                            PrintAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link);
                        }
                    }
                }
        }
		
		function PrintFormAlbumWeddingImage($numfile,$list_file,$link){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintFormAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link, $i);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintFormAlbumWeddingImage1Mod($list_file[$i],$link,$i);
                        }else{
                            PrintFormAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link, $i);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintFormAlbumWeddingImage2Mod($list_file[$i],$list_file[$i+1],$link, $i);
                        }else{
                            PrintFormAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link, $i);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintFormAlbumWeddingImage3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2],$link, $i);
                        }else{
                            PrintFormAlbumWeddingImage4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3],$link, $i);
                        }
                    }
                }
        }

        function PrintAlbumSkirtDelete($numfile,$list_file){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintAlbumSkirtDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintAlbumSkirtDelete1Mod($list_file[$i]);
                        }else{
                            PrintAlbumSkirtDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintAlbumSkirtDelete2Mod($list_file[$i],$list_file[$i+1]);
                        }else{
                            PrintAlbumSkirtDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintAlbumSkirtDelete3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2]);
                        }else{
                            PrintAlbumSkirtDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }
        }
        
        function PrintAlbumWeddingDelete($numfile,$list_file){
                if(($numfile%4)==0){
                    for($i=0; $i<$numfile; $i+=4){
                            PrintAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                }elseif(($numfile%4)==1){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-1)){
                           PrintAlbumWeddingDelete1Mod($list_file[$i]);
                        }else{
                            PrintAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }elseif(($numfile%4)==2){
                    for($i=0; $i<$numfile; $i+=4){
                        if($i==($numfile-2)){
                            PrintAlbumWeddingDelete2Mod($list_file[$i],$list_file[$i+1]);
                        }else{
                            PrintAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }else{
                    for($i=0; $i<$numfile; $i+=4){
                        if($i == $numfile-3){
                           PrintAlbumWeddingDelete3Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2]);
                        }else{
                            PrintAlbumWeddingDelete4Mod($list_file[$i],$list_file[$i+1], $list_file[$i+2], $list_file[$i+3]);
                        }
                    }
                }
        }
?>